import java.awt.Color;
import java.awt.Font;
import java.awt.GradientPaint;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.RenderingHints;
import java.awt.Shape;
import java.awt.geom.RoundRectangle2D;

import javax.swing.ButtonModel;
import javax.swing.JButton;


@SuppressWarnings("serial")
public class EmptyButton extends JButton {
	
	private GradientPaint GP;

	public EmptyButton(String text, int fontSize) {
		super();
		setText(text);
		setContentAreaFilled(false);
		setBorderPainted(false);

		
		setFont(new Font("Arial", Font.BOLD, fontSize));
		setFocusable(false);

	}

	public EmptyButton(Color startColor, Color endColor,
			Color rollOverColor, Color pressedColor) {
		super();

		setForeground(new Color(120, 120, 120));
		setFocusable(false);
		setContentAreaFilled(false);
		setBorderPainted(false);

	}
	

		public void paintComponent(Graphics g) {
		Graphics2D g2d = (Graphics2D) g.create();
		g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
				RenderingHints.VALUE_ANTIALIAS_ON);
		int h = getHeight();
		int w = getWidth();
		ButtonModel model = getModel();
		
		if (!model.isEnabled()) {
			setForeground(new Color(120, 120, 120));
		} else {
			
			if (model.isRollover()) {
				setForeground(new Color(90, 90, 90));
	    	} else {
				setForeground(new Color(150, 150, 150));
			}
		}
		
		g2d.setPaint(GP);
		if (model.isPressed()) {
			g2d.setPaint(GP);

		} else {
		}
		
		
		RoundRectangle2D.Float r2d = new RoundRectangle2D.Float(0, 0, w - 1,
				h - 1, 10, 10);
		Shape clip = g2d.getClip();
		g2d.clip(r2d);
		g2d.setClip(clip);

		
		g2d.dispose();

		super.paintComponent(g);
	}


}